<!--
  Copyright 2013-2019 the original author or authors.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<div class="card">
  <div class="card-header">
    <h2>Advanced</h2>
  </div>
  <div class="card-body">
    <div ng-hide="hideMainContent()">
      <div ng-include src="'template/gt-loading-overlay.html'"></div>
      <div ng-include src="'template/gt-http-error-overlay.html'"></div>
      <form gt-form-autofocus-on-first-input
            name="formCtrl"
            style="padding-top: 15px;"
            novalidate>
        <div gt-form-group
             gt-label="Immediate partial trace store threshold"
             gt-model="config.immediatePartialStoreThresholdSeconds"
             gt-number="true"
             gt-pattern="pattern.integer"
             gt-required="loaded"
             gt-disabled="!agentRollup.permissions.config.edit.advanced"
             gt-width="7em"
             gt-addon="seconds"
             ng-if="!isAgentRollup()">
          <div class="help-block">
            Any transaction that exceeds this amount of time will have its partial trace stored to
            disk immediately (prior to its completion).
            This is to guard against transactions which never complete (or at least run long
            enough and do enough harm to hang the jvm).
            In the case where some transactions have been configured with a very long slow threshold, the immediate
            partial trace store threshold does not take effect on those transactions until they have exceeded their slow
            threshold.
          </div>
        </div>
        <div gt-form-group
             gt-label="Max transaction aggregates per transaction type"
             gt-model="config.maxTransactionAggregates"
             gt-number="true"
             gt-pattern="pattern.integer"
             gt-required="loaded"
             gt-disabled="!agentRollup.permissions.config.edit.advanced"
             gt-width="7em"
             ng-if="!isAgentRollup()">
          <div class="help-block">
            The maximum number of transaction aggregates (aggregated by transaction name) that are stored per
            transaction type for any given minute.
            This is used to limit memory and storage when there are lots of distinct transaction names.
            Any transactions that do not make the cut are still aggregated and stored in the "Overall" transaction
            aggregate.
            This limit is applied per transaction type.
          </div>
        </div>
        <div gt-form-group
             gt-label="Max query aggregates per transaction aggregate"
             gt-model="config.maxQueryAggregates"
             gt-number="true"
             gt-pattern="pattern.integer"
             gt-required="loaded"
             gt-disabled="!agentRollup.permissions.config.edit.advanced"
             gt-width="7em">
          <div class="help-block">
            The maximum number of query aggregates (aggregated by query text) that are stored per transaction aggregate
            for any given minute.
            This is used to limit memory and storage when there are lots of distinct queries.
            During any given minute, up to ten times this number of query aggregates are stored in memory for the
            overall transaction aggregate and up to two times this number are stored in memory for named transaction
            aggregates.
            At the end of each minute, up to this number of query aggregates are stored to disk per transaction
            aggregate.
            Any queries / query aggregates that do not make the cut are aggregated and stored under the query text
            "LIMIT EXCEEDED BUCKET" (for their respective query type).
            In addition to this limit being applied during initial collection, it is also applied during rollups and
            when displaying query aggregates in the UI (over still larger time spans).
          </div>
        </div>
        <div gt-form-group
             gt-label="Max service call aggregates per transaction aggregate"
             gt-model="config.maxServiceCallAggregates"
             gt-number="true"
             gt-pattern="pattern.integer"
             gt-required="loaded"
             gt-disabled="!agentRollup.permissions.config.edit.advanced"
             gt-width="7em">
          <div class="help-block">
            The maximum number of service call aggregates (aggregated by service call text) that are stored per
            transaction aggregate for any given minute.
            This is used to limit memory and storage when there are lots of distinct service calls.
            During any given minute, up to ten times this number of service call aggregates are stored in memory for the
            overall transaction aggregate and up to two times this number are stored in memory for named transaction
            aggregates.
            At the end of each minute, up to this number of service call aggregates are stored to disk per transaction
            aggregate.
            Any service calls / service call aggregates that do not make the cut are aggregated and stored under the
            service call text "LIMIT EXCEEDED BUCKET" (for their respective service call type).
            In addition to this limit being applied during initial collection, it is also applied during rollups and
            when displaying service call aggregates in the UI (over still larger time spans).
          </div>
        </div>
        <div gt-form-group
             gt-label="Max trace entries per transaction"
             gt-model="config.maxTraceEntriesPerTransaction"
             gt-number="true"
             gt-pattern="pattern.integer"
             gt-required="loaded"
             gt-disabled="!agentRollup.permissions.config.edit.advanced"
             gt-width="7em"
             ng-if="!isAgentRollup()">
          <div class="help-block">
            Maximum number of trace entries collected for any given transaction.
            This is used to limit the memory of very long transactions that would capture
            potentially hundreds of thousands of trace entries (e.g. large batch or background
            operations).
            Also, the UI is not really optimized for viewing super large numbers of trace entries.
          </div>
        </div>
        <div gt-form-group
             gt-label="Max profile samples per transaction"
             gt-model="config.maxProfileSamplesPerTransaction"
             gt-number="true"
             gt-pattern="pattern.integer"
             gt-required="loaded"
             gt-disabled="!agentRollup.permissions.config.edit.advanced"
             gt-width="7em"
             ng-if="!isAgentRollup()">
          <div class="help-block">
            Maximum number of profile samples collected for any given transaction.
            This is used to limit the memory of very long transactions that would capture
            potentially hundreds of thousands of profile samples (e.g. large batch or background
            operations).
            Profile samples are merged where possible so this can generally be quite large.
          </div>
        </div>
        <div class="form-group row"
             ng-if="agentRollup.permissions.config.edit.advanced">
          <div class="offset-xl-3 col-xl-9">
            <div gt-button
                 gt-label="Save changes"
                 gt-click="save(deferred)"
                 gt-validate-form="formCtrl">
            </div>
          </div>
        </div>
      </form>
    </div>
  </div>
</div>
<!-- each page with confirmation dialog needs its own confirmation dom so that it is deleted on $destroy -->
<div ng-include="'template/gt-confirmation.html'"></div>
